/**
 * router 配置文件
 */
import React from "react";
import { Routes, Route, Navigate } from "react-router-dom";

import Books from "../pages/Books";
import Interviews from "../pages/Interviews";
import Issues from "../pages/Issues";
import AddIssue from "../pages/AddIssue";
import IssueDetail from "../pages/IssueDetail";
import BooksDetail from "../components/BooksDetail";
import SearchPage from "../pages/SearchPage";
import Personal from "../pages/Personal";

function Router() {
  return (
    <>
      <Routes>
        <Route path="/issues" element={<Issues />} />
        <Route path="/books" element={<Books />} />
        <Route path="/interviews" element={<Interviews />} />
        <Route path="/addIssue" element={<AddIssue />} />
        <Route path="/issue/:id" element={<IssueDetail />} />
        <Route path="/book/:id" element={<BooksDetail />} />
        <Route path="/searchPage" element={<SearchPage />} />
        <Route path="/personal" element={<Personal />} />
        {/* 重定向到首页 */}
        <Route path="/" element={<Navigate replace to="/issues" />} />
      </Routes>
    </>
  );
}

export default Router;
